library _;

import 'dart:async';
import 'dart:io';
import 'dart:ui';

import 'package:chewie/chewie.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/Const/IFinal.dart';
import 'package:flutter_app/Model/VideoModel.dart';
import 'package:flutter_app/Util/AssetUtils.dart';
import 'package:flutter_app/Util/CompressUtils.dart';
import 'package:flutter_app/Util/FileUtils.dart';
import 'package:flutter_app/Util/YOSS/YOSS.dart';
import 'package:flutter_app/View/MyLoader.dart';
import 'package:flutter_yfree/YFree.dart';
import 'package:video_player/video_player.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';

part "controller.dart";

part "view.dart";

class MainPage_Video extends YKeepAlivePage {
  List<VideoModel> models = [];
  bool autoNext = false;
  VideoPagerController? videoPagerController;

  @override
  void yOnCreate() async {
    this.models = await controller_loadData(true);
    setState(() {});
  }

  @override
  Widget yBuild(BuildContext context) {
    return AnnotatedRegion(
      value: SystemUiOverlayStyle.light,
      child: Container(
        color: Colors.black,
        child: Stack(
          children: [
            models.isEmpty ? MyLoader() : view_video(),
            view_publish(),
          ],
        ),
      ),
    );
  }
}
